<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>店铺授权</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="店铺名：">
            <el-input v-model="formInline.shop" placeholder="店铺名"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">绑定</el-button>
        </el-form-item>
    </el-form>
</div>
</body>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            formInline: {
                shop: "",
            }
        },
        methods: {
            onSubmit() {
                window.location =
                    "https://oauth.taobao.com/authorize?response_type=code&client_id=23700513&redirect_uri=http://opentrade.ews.m.jaeapp.com/taobaoUser/redirect&view=web&state=http://api.taoesou.com/api.aspx?platform=285%26act=bindshop_do%26shop=" + btoa(encodeURI("{\"shop\":\"" + this.formInline.shop + "\",\"sid\":2}"));

            }
        }
    })
</script>
<style>
    #app {
        width: 100%;
        text-align: center;
        padding-top: 20%;
    }
</style>
</html>
